<template>
  <el-dialog
    append-to-body
    top="30px"
    width="800px"
    title="客户详情"
    :close-on-click-modal="false"
    :before-close="beforeClose"
    :visible.sync="visible"
  >
    <el-form label-width="140px">
      <el-form-item label="客户名称：">{{ customerData.customer_name }}</el-form-item>
      <el-form-item label="经营地址：" v-if="isCompany">{{ customerData.address }}</el-form-item>
      <el-form-item label="组织类型：" v-if="isCompany">
        {{ customerData.org_class_name }}
      </el-form-item>
      <el-form-item label="统一信用代码：" v-if="isCompany">
        {{ customerData.register_no }}
      </el-form-item>
      <el-form-item label="负责人：" v-if="isCompany">{{ customerData.corp_name }}</el-form-item>
      <el-form-item label="家庭住址：">{{ customerData.family_address }}</el-form-item>
      <el-form-item label="身份证号：">{{ customerData.id_card }}</el-form-item>
      <el-form-item label="联系电话：">{{ customerData.mobile_no }}</el-form-item>
      <el-form-item label="婚姻状况：" v-if="!isCompany">
        {{ enumshowMarrType[customerData.marriage_status] }}
      </el-form-item>
      <el-form-item label="主营产业：">{{ customerData.main_business }}</el-form-item>
      <el-form-item label="经营范围：">{{ customerData.business_scope }}</el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import { enumshowMarrType } from '@/credit/plugins/enum'
export default {
  props: {
    visible: Boolean,
    customerData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      enumshowMarrType,
    }
  },
  computed: {
    isCompany() {
      return +this.customerData.customer_type === 1
    },
  },
  created() {},
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
  },
}
</script>
<style lang="scss" scoped></style>
